{% extends "jpbase.html" %}
{% block title %}OVIM - JOB POOL LIST{% endblock %}

{% block navbar %}
<a class="navbar" href="/ovim/listjp/"> >> JobPool List</a>
{% endblock %}

{% block action %}
<div class="action">
	<h3>ACTIONS</h3>
	<div id="actionmenu">
		<ul>
			<li>
				<a href="new/" title="Add a new JobPool">
					<img src="/ovim/media/img/list-add.png"/>
					New JobPool
				</a>
			</li>	
		</ul>
	</div>
</div>
{% endblock %}

{% block content %}
	{% if jps %}
		{% for item in jps %}
			<div class="ovim_content">
				<h3>Job Pool</h3>
				<div class="ovim_content_box">
					<img src="/ovim/media/img/jp.jpg" class="image" />
					<h2>{{ item.name }}</h2>
					<p class="ovim_content_box_comment">
						<img src="/ovim/media/img/Gravatar_30.gif"/>
						{% if item.comments %}
							{{ item.comments }}
						{% else %}
							No Comment
						{% endif %}
						<br><br>
					</p>
					<br>
					<div id="inner_content">
					<h3>Status</h3>
						{% if item.state %}
								{{ item.get_state_display }}
						{% else %}
								Never Run
						{% endif %}
						
					</div>
					<div id="inner_content">
						<h3>Target VM</h3>
						<ul>
							{% for vm in item.vmlist.all %}
								<li>{{ vm.name }}</li>
							{% endfor %}
						</ul>
					</div>
					<div class="content_action"><img src="/ovim/media/img/edit-find-replace.png" /><a href="{{ item.id }}/edit/">Edit</a></div>
					<div class="content_action"> <img src="/ovim/media/img/document-open.png"/><a href="{{ item.id }}/monitor">Monitor</a></div>
		    		<div class="content_action"> <img src="/ovim/media/img/edit-clear.png" /><a href="{{ item.id }}/delete/">Delete</a></div>
		    		<div class="content_action"> <img src="/ovim/media/img/selector-addall.gif"/><a href="{{ item.id }}/startnow/">Start Now</a></div>
		    	</div>
			</div>
		{% endfor %}
	{% else %}
		<div class="ovim_content">
			<h3>No JobPool had been set up yet.</h3>
		</div>
	{% endif %}
{% endblock %}